/**
 * clone
 *
 * @author nanxin.chen
 * @date 2015/8/22
 */
public class ObjectClone implements Cloneable {
    public int i = 1;
    public Integer obj = new Integer(2);

//    @Override
//    public ObjectClone clone() throws CloneNotSupportedException{
//        ObjectClone oc = (ObjectClone)super.clone();
//        return oc;
//    }

    public static void main(String[] args) throws Exception {
        ObjectClone oc1 = new ObjectClone();
        ObjectClone oc2 = (ObjectClone)oc1.clone();
        System.out.println("oc1:"+oc1.i);
        System.out.println("oc1:"+oc1.obj);
        oc1.i = 11;
        oc1.obj = new Integer(12);
        System.out.println("after alert oc1:");
        System.out.println("oc1:"+oc1.i);
        System.out.println("oc1:"+oc1.obj);
        System.out.println("oc2:"+oc2.i);
        System.out.println("oc2:"+oc2.obj);
    }
}
